package com.hiss.basic.model.system.domain;

import com.hiss.basic.starter.mybatis.constant.DataSourceConstant;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 系统用户 domain
 */
@Data
@Table(value = "sys_user", dataSource = DataSourceConstant.DEFAULT_DATASOURCE)
public class SysUserDomain implements Serializable {

    private static final long serialVersionUID = 1;

    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 邮箱地址
     */
    private String email;

    /**
     * 部门 ID
     */
    private Long deptId;

    /**
     * 启用状态
     *
     * @see com.hiss.basic.starter.core.enums.EnableStatusEnum
     */
    private Integer enableStatus;

    /**
     * 最后登陆时间
     */
    private LocalDateTime lastLoginTime;

    /**
     * 逻辑删除
     *
     * @see com.hiss.basic.starter.core.enums.DataLogicDeletedEnum
     */
    @Column(isLogicDelete = true)
    private Integer deleted;

    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    @Column(onUpdateValue = "now()")
    private LocalDateTime updateTime;
}
